package com.flame.shapeville.component.bonus1;

import javafx.scene.layout.AnchorPane;
import javafx.scene.shape.Shape;
import lombok.Getter;

/**
 * Base class for all custom shapes used in the bonus tasks.
 * Provides a common structure and layout for rendering shapes and their detailed views.
 *
 * @author Flame Dev Team
 * @version 1.0
 * @since 2025-05-18
 */
public class JfShape {
    /**
     * The main display pane for the shape.
     */
    @Getter
    AnchorPane shape = new AnchorPane();

    /**
     * The details pane that includes additional visual elements like formulas and explanations.
     */
    @Getter
    AnchorPane details = new AnchorPane();

    /**
     * The base shape graphics (e.g., Polygon) used for rendering.
     */
    @Getter
    Shape graphics;

    /**
     * The size of the shape.
     */
    double size;

    /**
     * X-coordinate center of the shape.
     */
    double centerX;

    /**
     * Y-coordinate center of the shape.
     */
    double centerY;

    /**
     * Default constructor.
     * Initializes the shape and details panes with default sizes and positions.
     */
    JfShape() {
        shape.setPrefSize(480, 240);
        details.setPrefSize(480, 240);
        size = 150;
        centerX = 240;
        centerY = 120;
    }

    /**
     * Loads the visual representation of the shape into the shape pane.
     */
    public void loadShape() {
        // Implemented in subclasses
    }

    /**
     * Loads the detailed view of the shape, including labels and formulas, into the details pane.
     */
    public void loadDetails() {
        // Implemented in subclasses
    }
}

